<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    
     <h:form>
        <p:commandButton value="REGRESAR AL LISTADO DE TIENDAS" 
                         update=":panelContent">
            <f:setPropertyActionListener
                target="#{navigationController.navigationContent}"
                value="./pages/administration/shop_view.xhtml" />
        </p:commandButton>
    </h:form>
    <hr />
   
        <h:form>
            <h1><h:outputText value="Crearo Editar Tienda"/></h1>
            <p:panelGrid columns="2">
                
                <p:outputLabel value="Name:" for="name" />
                <p:inputText id="name" value="#{shopRoleController.shop.name}" title="Name" required="true"
                             onblur="value=value.toUpperCase()"/>
                <p:outputLabel value="Address:" for="address" />
                <p:inputText id="address" value="#{shopRoleController.shop.address}" title="Address" />
                <p:outputLabel value="Phone:" for="phone" />
                <p:inputText id="phone" value="#{shopRoleController.shop.phone}" title="Phone" />
                <p:outputLabel value="Contact:" for="contact" />
                <p:inputText id="contact" value="#{shopRoleController.shop.contact}" title="Contact" />
                <p:outputLabel value="CompanyId:" for="companyId" />
                <h:selectOneMenu id="companyId" value="#{shopRoleController.shop.companyId}" 
                                 required="true" converter="entityConverter">
                    <!-- TODO: update below reference to list of available items-->
                    <f:selectItem itemLabel="SELECCIONE UN VALOR" noSelectionOption="true"/>
                    <f:selectItems value="#{shopRoleController.listCompany}" var="compa"
                                   itemLabel="#{compa.name}" itemValue="#{compa}" />
                </h:selectOneMenu>
            </p:panelGrid>
            <hr/>
             <p:commandButton value="Guardar Datos" action="#{shopRoleController.saveOrUpdateShop()}"
                             update="@form" />
        </h:form>
    
    
  
</ui:composition>
